#ifndef __MCCIRCLEVISUAL_H_
#define __MCCIRCLEVISUAL_H_

#include "MCPoint2D.h"
#include <MCGraphicsItem.h>
#include <MCCircle2D.h>

class MCCircleVisual : public MCGraphicsItem
{
public:

    MCCircleVisual(ICanvas *presenter, const MCCircle2D &circle);

    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
    bool contains(const QPointF &point) const override;
    QPainterPath shape() const override;

    MCCircle2D circle() const;

    void setGripAt(IGripPoint *grip, const MCPoint2D &pos) override;
    void resetGrips() override;

    void update(const MCPoint2D &center, double radius);
    void update(const MCCircle2D &circle);

protected:

    MCCircle2D transformed() const;
    void initGripPoints();

private:

    MCCircle2D _circleModel;

};

#endif // !__MCCIRCLEVISUAL_H_
